package school.valon.persistence.pojo;

import java.io.Serializable;

import javax.persistence.*;

import java.util.Date;
import java.util.List;


/**
 * The persistent class for the student database table.
 * 
 */
@Entity
@Table(name="student")
@PrimaryKeyJoinColumn(name="student_id", referencedColumnName="user_id")
@DiscriminatorValue("3")
@NamedQueries({
@NamedQuery(name="Student.findAll", query="SELECT s FROM Student s"),
@NamedQuery(name="Student.deleteById", query="DELETE FROM Student WHERE studentId = :P1")
})
public class Student extends User implements Serializable {

	private static final long serialVersionUID = 3326176704761721915L;

	@Column(name="student_id", insertable=false, updatable=false)
	private Integer studentId;

	@Temporal(TemporalType.DATE)
	@Column(name="birth_date")
	private Date birthDate;

	@Column(name="health_concerns")
	private String healthConcerns;

	@Column(name="health_insurance_number")
	private String healthInsuranceNumber;

	//bi-directional many-to-many association to Parent
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="father_id", referencedColumnName="parent_id")
	private Parent father;

	//bi-directional many-to-many association to Parent
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="mother_id", referencedColumnName="parent_id")
	private Parent mother;

	//bi-directional many-to-one association to StudentClassRecording
	@OneToMany(mappedBy="student", fetch=FetchType.LAZY)
	private List<StudentClassRecording> studentClassRecordings;

	//bi-directional many-to-one association to CourseOfferingStudentEnrolment
	@OneToMany(mappedBy="student", fetch=FetchType.LAZY)
	private List<CourseOfferingStudentEnrolment> courseOfferingStudentEnrolments;

	public Integer getStudentId() {
		return studentId;
	}

	public void setStudentId(Integer studentId) {
		this.studentId = studentId;
	}

	public Date getBirthDate() {
		return this.birthDate;
	}

	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	public String getHealthConcerns() {
		return this.healthConcerns;
	}

	public void setHealthConcerns(String healthConcerns) {
		this.healthConcerns = healthConcerns;
	}

	public String getHealthInsuranceNumber() {
		return this.healthInsuranceNumber;
	}

	public void setHealthInsuranceNumber(String healthInsuranceNumber) {
		this.healthInsuranceNumber = healthInsuranceNumber;
	}

	public List<StudentClassRecording> getStudentClassRecordings() {
		return this.studentClassRecordings;
	}

	public void setStudentClassRecordings(List<StudentClassRecording> studentClassRecordings) {
		this.studentClassRecordings = studentClassRecordings;
	}

	public List<CourseOfferingStudentEnrolment> getCourseOfferingStudentEnrolments() {
		return this.courseOfferingStudentEnrolments;
	}

	public void setCourseOfferingStudentEnrolments(List<CourseOfferingStudentEnrolment> courseOfferingStudentEnrolments) {
		this.courseOfferingStudentEnrolments = courseOfferingStudentEnrolments;
	}

	public Parent getFather() {
		return father;
	}

	public void setFather(Parent father) {
		this.father = father;
	}

	public Parent getMother() {
		return mother;
	}

	public void setMother(Parent mother) {
		this.mother = mother;
	}
}